home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
pc_board
/
cyb02pdc.zip
/
PDC.PRG
< prev
Wrap
Text File
|
1992-07-23
|
4KB
|
175 lines
set echo off
set talk on
clear all
close all
clear
* pcbdir : FoxPro DBF, step 1. PCBoard directory is read in as an SDF file.
* foxdir : FoxPro DBF, step 2. Final form, contains descriptions as memos.
* pcboard : PCBoard directory. I'll likely be using this to match file
* descriptions to floppy archive entries, so for me NEW is most
* appropriate.
store "pcbdir" to pcbdir
store "foxdir" to foxdir
store "new." to pcboard
select 2
use &foxdir
dele all
pack
select 1
use &pcbdir
dele all
pack
append from &pcboard type sdf
set talk off
clear
@ 0,0 say " CYBERPDC 2.00113ß (c) Copyright <<> westsmith 92/7/23"
define window upper from 1,0 to 12,79
define window lower from 13,0 to 24,79
activ window upper
activ window lower
set memowidth to 45
locked=.f.
spec=""
xspec=""
xdesc=""
xuploader=""
z1=""
goto top
do while not eof()
spec=file+subst(str(size),3)+date+" "
status=0
if locked then
status=1
else
status=0
endif
if ("-"=subst(date,5,1)) and ("-"=subst(date,8,1)) then
if not ""=ltrim(file) then
status=status+10
endif
endif
special=0
if "UPLOADED BY: "=upper(left(desc,13)) then
special=1
xuploader=subst(desc,14)
endif
do case
case special=1
otherwise
do case
case status=0
* looking for a file, line is not a file starter
case status=1
* reading description for a file, line is not a file starter
xdesc=rtrim(xdesc)+" "+rtrim(desc)
case status=10
* looking for a file, line contains file info
locked=.t.
do newfile
xspec=spec
xdesc=&pcbdir->desc
case status=11
* reading description for a file, line contains file info
do crush
do newfile
xspec=spec
xdesc=&pcbdir->desc
otherwise
endcase
if locked
if (""=ltrim(file)) then
do hurl with 1, repl(" ",31)+"| "+desc
else
do hurl with 1, spec+desc
endif
endif
endcase
skip
enddo
if locked then
do crush
endif
deac wind all
close all
return
procedure hurl
param z, y
* z : which window to use
* y : string to print
* --------------------------------------------------------------------------
if z=1 then
activ window upper
else
activ window lower
endif
?? left(y+repl(" ",78),78)
return
procedure repl
param z,y,x
* z : string
* y : string to replace
* x : string to replace with
* --------------------------------------------------------------------------
w=at(y,z)
do while w>0
z=left(z,w-1)+x+subst(z,w+len(y))
w=at(y,z)
enddo
return
procedure newfile
* no parameters
* --------------------------------------------------------------------------
select 2
append blank
repl name with left(&pcbdir->file,at(".",&pcbdir->file+".")-1)
repl ext with subst(&pcbdir->file,at(".",&pcbdir->file+".")+1)
repl size with &pcbdir->size
repl date with ctod(ltrim(&pcbdir->date))
select 1
return
procedure crush
* no parameters
* --------------------------------------------------------------------------
xdesc=xdesc+" "
do repl with xdesc," "," "
first=left(xdesc,46)
do while (" "<>right(first,1)) and (len(first)>0)
first=left(first,len(first)-1)
enddo
if ""=first then
first=left(xdesc,45)
endif
do hurl with 2,xspec+first
remains=ltrim(subst(xdesc,len(first)+1))
do while len(remains)>0
another=left(remains,46)
do while (" "<>right(another,1)) and (len(another)>0)
another=left(another,len(another)-1)
enddo
if ""=another then
another=left(remains,45)
endif
do hurl with 2, repl(" ",31)+"| "+another
remains=ltrim(subst(remains,len(another)+1))
enddo
select 2
repl desc with xdesc
repl uploader with xuploader
xuploader=""
select 1
return